package com.d3works.apps.base.service;

import com.d3works.apps.account.db.AccountManagement;
import com.d3works.apps.account.db.repo.AccountManagementRepository;
import com.d3works.apps.base.db.Company;
import com.d3works.apps.base.db.repo.CompanyRepository;
import com.d3works.inject.Beans;
import java.util.ArrayList;
import java.util.List;

public class PaymentModeServiceImpl implements PaymentModeService {

  @Override
  public List<AccountManagement> getAccountManagementDefaults() {
    List<AccountManagement> accountManagementList = new ArrayList<>();
    List<Company> companyList = Beans.get(CompanyRepository.class).all().fetch();
    for (Company company : companyList) {
      AccountManagement accountManagement = new AccountManagement();
      accountManagement.setCompany(company);
      accountManagement.setTypeSelect(AccountManagementRepository.TYPE_PAYMENT);
      accountManagementList.add(accountManagement);
    }
    return accountManagementList;
  }
}
